package ru.neoflex.datatable;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import ru.neoflex.dataobject.DataObject;

public class DataObjectImpl implements DataObject {
	private Map<String, Object> items;
	
	public DataObjectImpl(Map<String, Object> items) {
		super();
		this.items = items;
	}

	@Override
	public <T> T get(String property) {
		return (T) items.get(property);
	}

	@Override
	public void set(String property, Object value) {
		items.put(property, value);
	}

	@Override
	public Set<String> getProperties() {
		return items.keySet();
	}

	@Override
	public Class getType(String property) {
		Object value = items.get(property);
		return value == null ? null : value.getClass();
	}
	
	
}
